<?php

namespace AuctionBack\Controller;

use AuctionCore\System\AuctionException;
use AuctionCore\Other\LakalaBill;
use AuctionCore\Common\Page;

/**
 * 财务对账
 */
class ReconciliationController extends BaseController
{
    public function __construct()
    {
        parent::__construct();
    }

    public function index()
    {
        $p = I('get.p/d',1);
        $page_size = 8;
        $params = array(
            'start_date' => I('get.start_date'),
            'end_date' => I('end_date')
        );
        $La = new LakalaBill();

        $list = $La->getList($p,$page_size,$params);
        $total = $La->getTotal($params);
        $Page = new Page($total, $page_size);
        $show = $Page->platform_show();
        $this->assign('page',$show);
        $this->assign('list', $list);
        $this->assign("params", $params);
        $this->display();
    }

    public function detail()
    {
        $id = I('get.id/d', 0);
        if ($id < 1) {
            exit;
        }
        $p = I('get.p/d', 1);
        $limit = 10;
        $params = array(
            'id' => $id,
            'user_name' => I('get.user_name', ''),
            'real_name' => I('get.real_name', ''),
            'mobile' => I('get.mobile', ''),
            'start_time' => I('get.start_time', ''),
            'end_time' => I('get.end_time', '')
        );
        $La = new LakalaBill();
        $list = $La->getDetailList($p, $limit, $params);
        $count = $La->getDetailCount($params);
        $Page = new Page($count, $limit);
        $show = $Page->platform_show();
        $this->assign('list', $list);
        $this->assign('params', $params);
        $this->assign('page', $show);
        $this->display();
    }
}